<?php
	session_start();
	if(!isset($_SESSION['quid'])||!isset($_SESSION['thisevent'])){//如果不是管理员登录无法获取签到数据表
		echo "";
		exit();
	}
	// Disable caching of the current document:  
	header('Cache-Control: no-cache, no-store, max-age=0, must-revalidate');  
	header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); // Date in the past  
	header('Pragma: no-cache');  
	$conn = mysqli_connect("localhost", "root", "", "signin");
	mysqli_query($conn,"set names utf8");
	$thisevent=$_SESSION['thisevent'];
	$result = mysqli_query($conn,"select * from persons WHERE event='$thisevent'"); //执行SQL查询指令
	if(!$row = mysqli_fetch_assoc($result)){
		echo "没有对应数据！";
		exit();
	}
	//mysqli_query($conn,"set names utf8");
	//$result = mysqli_query($conn,"select * from persons WHERE event='$eventname'"); //执行SQL查询指令
	$sx=1;
	echo "<br/><table border=1>\n<tr><td>&nbsp;顺序&nbsp;</td><td>&nbsp;签到者姓名&nbsp;</td><td>&nbsp;扫码时间&nbsp;</td></tr>\n";
	while($rows = mysqli_fetch_row($result)){//使用while遍历所有记录，并显示在表格的tr中
		echo "<tr>";
		echo "<td>&nbsp;".$sx."&nbsp;</td>";
		echo "<td>&nbsp;".$rows[1]."&nbsp;</td>";
		echo "<td>&nbsp;".$rows[3]."&nbsp;</td>";
		echo "</tr>\n";
		$sx++;
	}
	echo "</table>\n";
?>